package seeders

import (
	"github.com/goravel/framework/facades"
	"goravel/app/models"
)

type ProcessStateSeeder struct {
}

// Signature The name and signature of the seeder.
func (s *ProcessStateSeeder) Signature() string {
	return "ProcessStateSeeder"
}

// Run executes the seeder logic.
func (s *ProcessStateSeeder) Run() error {
	process_states := []models.ProcessState{
		{
			Type:       1,
			Status:     1,
			StatusName: "已派单",
		},
		{
			Type:       1,
			Status:     2,
			StatusName: "双方签字",
		},
		{
			Type:       1,
			Status:     3,
			StatusName: "维修班班长确认",
		},
		{
			Type:       1,
			Status:     4,
			StatusName: "完结",
		},

		{
			Type:       2,
			Status:     1,
			StatusName: "已派单",
		},
		{
			Type:       2,
			Status:     2,
			StatusName: "双方签字",
		},
		{
			Type:       2,
			Status:     3,
			StatusName: "维修班班长确认",
		},
		{
			Type:       2,
			Status:     4,
			StatusName: "维修作业长签字",
		},
		{
			Type:       2,
			Status:     5,
			StatusName: "完结",
		},
	}

	return facades.Orm().Query().Model(&models.ProcessState{}).Create(&process_states)
}
